<?php
//分页
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header('Content-Type:application/json; charset=utf-8');

include_once '../public/con-db.php';
$new = @$_POST['page'];

$page = 5;
$pages = $new*$page;
$star = $pages-5;

$sql = "SELECT * FROM `course` LIMIT $star,$pages";  
$result = $conn->query($sql);

$arrs = array();
$i=0;
while($rows = mysqli_fetch_assoc($result)){
	$arrs[$i]=$rows;
	$i++;
 }
print_r (json_encode($arrs));

?>